home *** CD-ROM | disk | FTP | other *** search
- Path: gaia.ns.utk.edu!mbk
- From: mbk@caffeine.engr.utk.edu (Matt Kennel)
- Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
- Subject: Re: The Good, the Bad, the Ugly, and the Wicked ...
- Followup-To: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
- Date: 8 Apr 1996 19:40:42 GMT
- Organization: University of Tennessee, Knoxville and Oak Ridge National Laboratory
- Message-ID: <4kbq3q$1i8@gaia.ns.utk.edu>
- References: <31570B8E.5A12@vmark.com> <4je5rq$7qg@mimas.brunel.ac.uk> <4jes0t$gth@decaxp.HARVARD.EDU> <31630E30.5A02@oma.com>
- Reply-To: kennel@msr.epm.ornl.gov
- NNTP-Posting-Host: caffeine.engr.utk.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Robert C. Martin (rmartin@oma.com) wrote:
- : It is neither wrong nor right. There are certainly some real-time systems
- : that are incompatible with certain GC strategies. There may indeed
- : be some real-time applications that are incompatible with *any* GC
- : strategy, (other than manual GC).
-
- : In any case, it matters little. The more intense the real-time
- : constraint, the more work the engineer will have to go through
- : to manage the automatic garbage collector. (e.g., turning it on or off,
- : throttling it, forcing unscheduled collections, etc.) Thus, eventually
- : one merely trades the job of managing memory, for the job of
- : managing the collector.
-
- It is not a trade, as nearly all garbage collection systems still
- *allow* manual memory management.
-
- A garbage collector provides a potential solution that is very difficult
- to do without.
-
- : > It has also been pointed out by people who appear understand
- : > g.c. that non-g.c. systems such as C cannot be inherently relied
- : > upon in real-time applications; calls to the memory allocation
- : > system (malloc or new) may not have defined time bounds.
-
- : Malloc and new can *always* be made to be deterministic. That is
- : one of the major attractions to manual memory management in
- : real time systems. You can use malloc/free (new/delete) pairs which are
- : 100% predictable.
-
- Are they? Have you gone through the all the possible orderings of
- previous 'new' and 'malloc' so that you ***KNOW*** exactly
- what the internal heap structures are so that subsequent calls to
- 'malloc' and 'new' and 'free' take a known amount of time?
-
- The point is that standard library malloc and new are themselves already
- one level of 'automatic' storage allocation compared to fixed 'Fortran'
- blocks of storage and have potentially harmful real time implications.
-
- Thus the distinction should not be "GC" vs "malloc" but really
-
- "GC or malloc" vs "static fixed storage."
-
- If you accept 'malloc' you are relying on some automatic procedure already.
-
-
-